<template>
  <div class="songDetailRigth">
    <div class="linkSongs">
      <h3>喜欢这个歌单的人</h3>
      <div class="person-img">
        <a  v-for="subscriber in songDetailRigth" href="" :key="subscriber.nickname" :title="subscriber.nickname">
        <img :src="subscriber.avatarUrl?subscriber.avatarUrl:subscriber.backgroundUrl " :alt="subscriber.nickname" />
        </a>
      </div>
    </div>
    <div>
      <h3>热门歌曲</h3>
      <ul class="hotSongs" >
        <li class="hotSong-img" v-for="hotsong in hotlist" :key="hotsong.id">
          <img :src="hotsong.coverImgUrl" :alt="hotsong.alg" />
          <div class="hotSong-title">
            <p>{{hotsong.name}}</p>
            <span>by {{hotsong.creator.nickname}}</span>
          </div>
        </li>
      </ul>
    </div>
    <Multiport />
  </div>
   
</template>

<script>
// subscribers 喜欢这个歌单的
import {reqGetSongslist} from '@/api/playlist'
import Multiport from '@/components/Multiport-right'
import {mapState} from 'vuex'
export default {
  name: 'SongDetailRigth',
  data() {
    return {
      hotlist:{}
    }
  },
  components:{
    Multiport
  },
  computed:{
    ...mapState("songdetail",["songDetailRigth"])
  },
async mounted(){
   const limit=5
    const {playlists}=await reqGetSongslist('全部',limit)
    this.hotlist=playlists
    // console.log(playlists)
  }
}
</script>

<style lang="less" scoped>
.songDetailRigth {
  width: 200px;
  padding: 20px 30px 40px 30px;
  h3 {
    line-height: 23px;
    margin-bottom: 20px;
    border-bottom: 1px solid #ccc;
    color: #333;
    font-size: 12px;
  }
}
.person-img {
  margin-left: -13px;
  img {
    width: 40px;
    padding: 0 0 13px 13px;
  }
}
.hotSongs{
  padding-bottom:20px;
  }
.hotSong-img {
  margin-bottom: 20px;
  display: flex;
  flex-wrap: nowrap;
  img {
    padding-right: 8px;
    width: 50px;
    flex-shrink: 0;
  }
  .hotSong-title {
    flex-shrink: 0;
    p {
      width: 140px;
      font-size: 14px;
      line-height: 24px;
      color: #000;
      padding-bottom: 5px;
      overflow: hidden;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    span{
      color: #666;
    }
  }
}
</style>
